package com.zr.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.zr.dao.OverDaoWW;
import com.zr.util.JDBCUtil;

public class OverDaoImplWW implements OverDaoWW {

	@Override
	public boolean overtimeApplication(String date, String btime, String etime,
			String wcontent, String opinion, int eid) {
		boolean flag = false;
		StringBuffer sql = new StringBuffer();
		sql.append(" INSERT INTO overtime (overtime.date, overtime.btime, overtime.etime,overtime.wcontent, overtime.opinion, overtime.eid) ");
		sql.append(" VALUES (?, ?,?, ?, ?, ?) ");
		Connection con = JDBCUtil.getConnection();
		try {
			PreparedStatement pst = con.prepareStatement(sql.toString());
			pst.setString(1,date );
			pst.setString(2,btime);
			pst.setString(3, etime);
			pst.setString(4,wcontent);
			pst.setString(5, opinion);
			pst.setInt(6, eid);
			int i =   pst.executeUpdate();
			if(i>0){
				flag =true;
			}
			 pst.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return flag;
	}



		
	}
	
	
	
	
	
